﻿@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>机能一览</title>
    <link href="~/Content/css/layui.css" rel="stylesheet" />
</head>
<body>
    <div class="main layui-clear">
        <div class="layui-form layui-form-pane">
            <input type="hidden" id="pid" />
            <div class="wrap">
                <table id="pages" lay-filter="pages"></table>
            </div>
        </div>
    </div>
</body>
</html>
<script type="text/html" id="StaffNoTpl">
    <a href="#" class="layui-table-link" lay-event="sno">{{d.No || ''}}</a>
</script>
<script src="~/Content/layui.js"></script>
<script>
    layui.use(['jquery', 'table'], function () {
        var $ = layui.jquery;
        var table = layui.table;
        table.render({
            elem: '#pages'
            , height: 500
            , width :460
            , title: '机能一览'
            , url: '/Project/PageInfoList?pid=' + $("#pid").val()
            , autoSort: false
            , cols: [[
                { type: 'numbers' }
                , { field: 'No', title: '机能ID', width: 160, templet: '#StaffNoTpl' }
                , { field: 'PageName', title: '机能名称', width: 240 }
            ]]
        });

        table.on('tool(pages)', function (obj) {
            var data = obj.data;
            if (obj.event === 'sno') {
                $('#PageId', parent.document).val(data.No);
                $('#PageName', parent.document).val(data.PageName);
                parent.layer.close(parent.layer.getFrameIndex(window.name));
            }
        });

    });
    function child(pid) {
        document.getElementById("pid").value = pid;
    }
</script>